<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>DrawTool - Documentation</title>
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav>
    <li class="nav-link nav-home-link"><a href="index.html">easymap-ui</a></li><li class="nav-heading nav-heading-main">Classes</li><li class="nav-heading nav-heading-sub"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="DrawTool.html">DrawTool</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#clear">clear</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#draw">draw</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#drawCircle">drawCircle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#drawLineString">drawLineString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#drawPoint">drawPoint</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#drawPolygon">drawPolygon</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#drawRectangle">drawRectangle</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#getEditTool">getEditTool</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#toggleEdit">toggleEdit</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DrawTool.html#toggleSnap">toggleSnap</a></span></li><li class="nav-heading nav-heading-sub"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="EasyMap.html">EasyMap</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#animate">animate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#getCenter">getCenter</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#getExtent">getExtent</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#getMapCanvas">getMapCanvas</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#getMapElement">getMapElement</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#getViewElement">getViewElement</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#getZoom">getZoom</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#initDrawTool">initDrawTool</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#initMap">initMap</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#setCenter">setCenter</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#setTileGridVisible">setTileGridVisible</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="EasyMap.html#setZoom">setZoom</a></span></li><li class="nav-heading nav-heading-sub"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="SnapTool.html">SnapTool</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SnapTool.html#getPixelTolerance">getPixelTolerance</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SnapTool.html#getSnapPoint">getSnapPoint</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SnapTool.html#setActive">setActive</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="SnapTool.html#setPixelTolerance">setPixelTolerance</a></span></li>
</nav>

<div id="main">
    
    <h1 class="page-title">DrawTool</h1>
    

    




<section>

<header>
    
        
            <div class="class-description"><p>初始化构造函数</p></div>
        
    
</header>

<article>
    <div class="container-overview">
    
        
<div class="section-method">

    
    <h2>Constructor</h2>
    

    <h4 class="name" id="DrawTool"><span class="type-signature"></span>new DrawTool<span class="signature">(map, isEditTool<span class="signature-attributes"><可选></span>)</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>参数名</th>
        

        <th>参数类型</th>

        
        <th>参数规则</th>
        

        
        <th>默认值</th>
        

        <th class="last">参数描述</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>ol.Map</code></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">
                <p>map</p>
                
            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isEditTool</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            
                <td class="attributes">
                
                    <span class="optional">可选</span><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last">
                <p>是否编辑工具</p>
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            
<div class="section-method">

    

    <h4 class="name" id="clear"><span class="type-signature"></span>clear<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>清除绘制</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="draw"><span class="type-signature"></span>draw<span class="signature">(type)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>绘制，取值于 GEOMETRYTYPE</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>参数名</th>
        

        <th>参数类型</th>

        

        

        <th class="last">参数描述</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>绘制类型</p>
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="drawCircle"><span class="type-signature"></span>drawCircle<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>绘制圆</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="drawLineString"><span class="type-signature"></span>drawLineString<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>绘制线</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="drawPoint"><span class="type-signature"></span>drawPoint<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>绘制点</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="drawPolygon"><span class="type-signature"></span>drawPolygon<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>绘制面</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="drawRectangle"><span class="type-signature"></span>drawRectangle<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>绘制矩形</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="getEditTool"><span class="type-signature"></span>getEditTool<span class="signature">()</span><span class="type-signature"> &rarr; {EditTool}</span></h4>

    



<div class="description">
    <p>获取编辑工具</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





















<div class="section-returns">
<h5>Returns:</h5>

        

<dl class="param-type">
    <dt>
        Type:
    </dt>
    <dd>
        
<span class="param-type"><code>EditTool</code></span>


    </dd>
</dl>


<div class="param-desc">
    <ul>
<li>编辑工具</li>
</ul>
</div>

    
</div>



</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="toggleEdit"><span class="type-signature"></span>toggleEdit<span class="signature">(isEdit)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>切换编辑状态</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>参数名</th>
        

        <th>参数类型</th>

        

        

        <th class="last">参数描述</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>isEdit</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>切换编辑状态</p>
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="toggleSnap"><span class="type-signature"></span>toggleSnap<span class="signature">(isSnap)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>切换捕捉状态</p>
</div>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>参数名</th>
        

        <th>参数类型</th>

        

        

        <th class="last">参数描述</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>isSnap</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">
                <p>切换捕捉状态</p>
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
        
    

    

    
</article>

</section>




</div>

<br class="clear">

<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>